%{
#include "hello.tab.h"
#include "stdlib.h"
#include <string>
using namespace std;
extern "C" int yylex();
%}

%%
^([bB][eE][gG][iI][nN]) 	return(START);
^([eE][nN][dD]) 		return(END);
^[Ss]+ 				{ yylval.size = strdup(yytext); return(INT); }
([mM][oO][vV][eE])		return(MOVE);
([tT][oO])			return(TO);				
([aA][dD][dD])			return(ADD);
([rR][eE][aA][dD])		return(READ);
([pP][rR][iI][nN][tT])		return(PRINT);
\.$				return(ENDLINE);
\"(\\.|[^"])*\"                 return(STRING);
,				return(COMMA);
([a-zA-Z]+[a-zA-Z0-9_-]*)	{ yylval.id = strdup(yytext); return(IDENTIFIER); }
[0-9]+				{ yylval.num = strdup((yytext)); return(NUMBER); }

%%

int yywrap(void) {
    return 1;
}
